package personal.lijun.skeleton.springcloud.utils.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import personal.lijun.skeleton.springcloud.utils.validate.ParamValidAdvice;

/**
 * @Auther: lijun@sstcsoft.com
 * @Date: 2019/9/11 11:08
 */

@Configuration
public class UtilsConfig {

    @Bean
    @ConditionalOnProperty(name = "api.param.validate",havingValue ="true")
    @ConditionalOnMissingBean(ParamValidAdvice.class)
    public ParamValidAdvice paramValidAdvice(){
        return new ParamValidAdvice();
    }
}
